﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OthelloGame
{
   

    public class OthelloBoardGamePiece
    {
        private PieceColors color;

        public PieceColors PieceColor
        {
            get
            {
                return color;
            }
        }

        public Boolean IsWhite
        {
            get
            {
                return color == PieceColors.White;
            }
        }
        public Boolean IsBlack
        {
            get
            {
                return color == PieceColors.Black;
            }
        }
        public OthelloBoardGamePiece(PieceColors newPieceColor)
        {
            color = newPieceColor;
        }



        #region equals
        // override object.Equals
        public override bool Equals(object obj)
        {

            if (obj == null || GetType() != obj.GetType())
            {
                return false;
            }
            
            return color == ((OthelloBoardGamePiece)obj).color;
        }

        // override object.GetHashCode
        public override int GetHashCode()
        {
            int hash = 1;
            int prime = 31;
            hash = hash * prime + this.color.ToString().GetHashCode();
            return hash;
        }
        #endregion
   
    }
    public enum PieceColors
    {
        Black,
        White
    };
}
